<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"
	trimDirectiveWhitespaces="true"%>
<%@page import="java.util.Date"%>
<%@ include file="../admin.inc.jsp"%>

<div class="pageHeader">
	<form method="post" id="pagerForm" action="${webContextPath}/admin/acntWithdraw/list" onsubmit="return navTabSearch(this)">
	<input type="hidden" name="pageNum" id="pageNum" value="${pageInfo.pageNum}" />
	<input type="hidden" name="numPerPage" id="numPerPage" value="${pageInfo.numPerPage}"/>
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label>用户ID：</label>
				<input id="userId" type="text" name="userId" value="${userId}" class="textInput">
			</li>
			
			<li>
				<label>状态：</label>
				<select id = "approveStatus" name="approveStatus" >
					<option value="" ></option>
					<option value="01"  ${approveStatus=="01"?"selected":""}>待审核</option>
					<option value="02"  ${approveStatus=="02"?"selected":""}>驳回</option>
					<option value="03"  ${approveStatus=="03"?"selected":""}>审核通过</option>
					<option value="04"  ${approveStatus=="04"?"selected":""}>已转账</option>
				</select>
			</li>
		</ul>
		<ul class="searchContent">	
			<li>
				<label>申请时间：</label>
				<input id="createBeginTime"  class="Wdate" type="text"  name="createBeginTime" 
				value="<fmt:formatDate value='${createBeginTime}' pattern="yyyy-MM-dd HH:mm:ss" />"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="true">
				<a class="inputDateButton" style="float:right; "  href="javascript:;">选择</a>
			</li>
			
			<li>
				<label>        -</label>	
				<input id="createEndTime"  class="Wdate" type="text"  name="createEndTime" 
				value="<fmt:formatDate value='${createEndTime}' pattern="yyyy-MM-dd HH:mm:ss" />"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="true">
				<a class="inputDateButton" style="float:right; "  href="javascript:;">选择</a>
			</li>
		</ul>
		<ul class="searchContent">	
			<li>
				<label>金额：</label>
				<input id="minAmount"  type="text"  name="minAmount"  value='${minAmount}'>
			</li>
			
			<li>
				<label>        -</label>	
				<input id="maxAmount"  type="text"  name="maxAmount"  value='${maxAmount}'>
			</li>
			
			<li>
				<label>户名：</label>
				<input id="bankAcntName" type="text" name="bankAcntName" value="${bankAcntName}" class="textInput">
			</li>
			
			<li>
				<label>账号：</label>
				<input id="bankAcntNo" type="text" name="bankAcntNo" value="${bankAcntNo}" class="textInput">
			</li>
			
			<li>
				<label>银行：</label>
				<input id="bankName" type="text" name="bankName" value="${bankName}" class="textInput">
			</li>
		
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent j-resizeGrid">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a iconClass="page_white_text" href="${webContextPath}/admin/acntWithdraw/detail?id={acntWithdrawId}" target="navTab" mask="true"
               width="530" height="500" title="查看详情" rel="acntWithdrawDetail">
               <span>查看详情</span>
            </a></li>
            <li><a iconClass="page_excel"  onclick="exportExcel()" target="_self" title="确实要导出这些记录吗?" ><span>导出EXCEL</span></a></li>
		</ul>
	</div>
	<div class="grid" layouth="115" style="width: 1149px; overflow: auto;">
	<table class="table" width="100%">
		<thead>
			<tr>
				<th width="40">ID</th>
				<th width="70">用户ID</th>
				<th width="70">公司名称</th>
				<th width="70">用户昵称</th>
				<th width="70">用户真实姓名</th>
				<th width="50">提现金额</th>
				<th width="50">户名</th>
				<th width="50">账号</th>
				<th width="50">银行</th>
				<th width="50">申请时间</th>
				<th width="50">状态</th>
			</tr>
		</thead>
		<tbody style="text-align:center">
			<c:forEach var="item" items="${list}">
				<tr target="acntWithdrawId" rel="${item.id}" style="">
					<td>${item.id}</td>
					<td>${item.userId}</td>
					<td>${item.companyName}</td>
					<td>${item.nickName}</td>
					<td>${item.realName}</td>
					<td>${item.amount}</td>
					<td>${item.bankAcntName}</td>
					<td>${item.bankAcntNo}</td>
					<td>${item.bankName}</td>
					<td><fmt:formatDate value='${item.createTime}' pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td>
					<select disabled="disabled" style="width:100%;">
						<option value="01"  ${item.approveStatus=="01"?"selected":""}>待审核</option>
						<option value="02"  ${item.approveStatus=="02"?"selected":""}>驳回</option>
						<option value="03"  ${item.approveStatus=="03"?"selected":""}>审核通过</option>
						<option value="04"  ${item.approveStatus=="04"?"selected":""}>已转账</option>
					</select>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	</div>
	<div class="panelBar" style="bottom:0px">
		<div class="pages">			
			<span>共${size}条</span>
		</div>
		<div class="pagination" targettype="navTab" totalcount="${size}" 
		numperpage="${pageInfo.numPerPage}" pagenumshown="10" currentpage="${pageInfo.pageNum}">
		</div>
	</div>
</div>
<script language="JavaScript"> 
  function exportExcel(){
	  var ext = '';
	  var userId = $('#userId').val();
	  if(userId!=''){
		  ext = '?userId='+userId;
	  }
	  var approveStatus = $('#approveStatus').val();
	  if(approveStatus!=''){
		  if(ext!=''){
			  ext = ext + '&approveStatus='+approveStatus;
		  } else {
			  ext = '?approveStatus='+approveStatus;
		  }
	  }
	  var createBeginTime = $('#createBeginTime').val();
	  if(createBeginTime!=''){
		  if(ext!=''){
			  ext = ext + '&createBeginTime='+createBeginTime;
		  } else {
			  ext = '?createBeginTime='+createBeginTime;
		  }
	  }
	  var createEndTime = $('#createEndTime').val();
	  if(createEndTime!=''){
		  if(ext!=''){
			  ext = ext + '&createEndTime='+createEndTime;
		  } else {
			  ext = '?createEndTime='+createEndTime;
		  }
	  }
	  var minAmount = $('#minAmount').val();
	  if(minAmount!=''){
		  if(ext!=''){
			  ext = ext + '&minAmount='+minAmount;
		  } else {
			  ext = '?minAmount='+minAmount;
		  }
	  }
	  var maxAmount = $('#maxAmount').val();
	  if(maxAmount!=''){
		  if(ext!=''){
			  ext = ext + '&maxAmount='+maxAmount;
		  } else {
			  ext = '?maxAmount='+maxAmount;
		  }
	  }
	  var bankAcntName = $('#bankAcntName').val();
	  if(bankAcntName!=''){
		  if(ext!=''){
			  ext = ext + '&bankAcntName='+bankAcntName;
		  } else {
			  ext = '?bankAcntName='+bankAcntName;
		  }
	  }
	  var bankAcntNo = $('#bankAcntNo').val();
	  if(bankAcntNo!=''){
		  if(ext!=''){
			  ext = ext + '&bankAcntNo='+bankAcntNo;
		  } else {
			  ext = '?bankAcntNo='+bankAcntNo;
		  }
	  }
	  var bankName = $('#bankName').val();
	  if(bankName!=''){
		  if(ext!=''){
			  ext = ext + '&bankName='+bankName;
		  } else {
			  ext = '?bankName='+bankName;
		  }
	  }
	  var url = '${webContextPath}/admin/acntWithdraw/exportExcel'+ext;
	  window.location.href=url;
  }
</script>